package com.huajx.jrb.controller;

import com.huajx.core.annotation.Route;
import com.huajx.core.handler.Controller;
import com.huajx.util.io.FileUtil;

import java.io.File;

@Route(controllerKey = "/")
public class IonicController extends Controller {
    private final static File file = FileUtil.file("data/app-data.json");
    public void index(){
        render("/alian/index.html");
    }

    public void appdata(){
        if(file.exists()){
            renderJson(FileUtil.readUtf8String(file));
        }else{
            renderJsonSuccess();
        }
    }
}
